package models

import "gorm.io/gorm"

type Order struct {
	UserId int
	Type   string
	gorm.Model
}
type OrderFoodLink struct {
	OrderId int
	FoodId  int
}

func (o *Order) GetOrderList(page int) (orders []Order, err error) {
	err = DB.Limit(5).Offset((page - 1) * 5).Find(&orders).Error
	return orders, err
}
func (o *Order) DelOrderById() (err error) {
	return DB.Delete(&o).Error
}
